<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">


<ui:composition template="/WEB-INF/template/templateAdmin.xhtml">
	<ui:define name="content">
		<f:view locale="#{language.locale}">
			<br />
			<br />
			<p class="SLSelectDate">#{msg.searchByDate}</p>
			<br />
			<div class="SLSelectDate">
				<h:form id="menus">
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#{msg.from1}:	&nbsp;&nbsp;&nbsp;&nbsp;#{msg.day}
			
<h:selectOneMenu id="day1" value="#{dateDTOController.date.day}">
						<f:selectItems value="#{dateDTOController.day1}"></f:selectItems>
						<f:ajax event="change"
							render="year2 month2 day2 year1 month1 day1"
							listener="#{dateDTOController.leftListener}"></f:ajax>
					</h:selectOneMenu>
#{msg.month}
<h:selectOneMenu id="month1" value="#{dateDTOController.date.month}">
						<f:selectItems value="#{dateDTOController.month1}"></f:selectItems>
						<f:ajax event="change"
							render="year2 month2 day2 year1 month1 day1"
							listener="#{dateDTOController.leftListener}"></f:ajax>
					</h:selectOneMenu>
#{msg.year}
<h:selectOneMenu id="year1" value="#{dateDTOController.date.year}">
						<f:selectItems value="#{dateDTOController.year1}" />
						<f:ajax event="change"
							render="year2 month2 day2 year1 month1 day1"
							listener="#{dateDTOController.leftListener}"></f:ajax>
					</h:selectOneMenu>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#{msg.to}:	&nbsp;&nbsp;&nbsp;&nbsp;			
#{msg.day}
<h:selectOneMenu id="day2" value="#{dateDTOController.date2.day}">
						<f:selectItems value="#{dateDTOController.day2}"></f:selectItems>
						<f:ajax event="change"
							render="year2 month2 day2 year1 month1 day1"
							listener="#{dateDTOController.rightListener}"></f:ajax>
					</h:selectOneMenu>
#{msg.month}
<h:selectOneMenu id="month2" value="#{dateDTOController.date2.month}">
						<f:selectItems value="#{dateDTOController.month2}"></f:selectItems>
						<f:ajax event="change"
							render="year2 month2 day2 year1 month1 day1"
							listener="#{dateDTOController.rightListener}"></f:ajax>
					</h:selectOneMenu>
#{msg.year}
<h:selectOneMenu id="year2" value="#{dateDTOController.date2.year}">
						<f:selectItems value="#{dateDTOController.year2}" />
						<f:ajax event="change"
							render="year2 month2 day2 year1 month1 day1"
							listener="#{dateDTOController.rightListener}"></f:ajax>
					</h:selectOneMenu>
					<br />
					<br />
					<br />
					<h:commandButton class="createRepositoryButton"
						value="#{msg.search}" style="height: 29px; width: 100px; "
						action="#{dateDTOController.printDate}"
						rerender="wrapper noresults">
					</h:commandButton>
					<br></br>
					<h:message for="year2" style="color:red" />
				</h:form>
			</div>
			<br />
			<br />
			<br />
			<br />
			<center>
				<h:form id="form2">
					<h:outputText rendered="#{dateDTOController.show}"
						value="#{msg.searchResults}" class="SLSearchByType" />
					<br />
					<br />
					<h:panelGroup id="wrapper" rendered="#{dateDTOController.show}">
						<h:dataTable id="dt1" value="#{dateDTOController.result}"
							var="item" styleClass="order-table"
							headerClass="order-table-header"
							rowClasses="order-table-odd-row,order-table-even-row"
							columnClasses="order-table-column" cellpadding="10em">



							<h:column headerClass="leftHead">
								<f:facet name="header">
									<h:commandLink class="ZsomborSearch"
										action="#{dateDTOController.sortById}">
										<h:outputText value="id" />
										<h:panelGroup rendered="#{dateDTOController.showIdIcon}">
											<h:graphicImage
												rendered="#{dateDTOController.sortAscending}"
												value="/resources/images/icon_up_sort_arrow.png" />
											<h:graphicImage
												rendered="#{!dateDTOController.sortAscending}"
												value="/resources/images/icon_down_sort_arrow.png" />
										</h:panelGroup>
									</h:commandLink>
								</f:facet>
								<h:outputText value="#{item.id}" />
							</h:column>


							<h:column>
								<f:facet name="header">
									<h:outputText value="#{msg.logType}" />
								</f:facet>
								<h:outputText value="#{msg[item.logType]}" />
							</h:column>

							<h:column>
								<f:facet name="header">
									<h:outputText value="#{msg.content}" />
								</f:facet>
								<h:outputText value="#{item.content}" />
							</h:column>

							<h:column>
								<f:facet name="header">
									<h:outputText value="#{msg.date}" />
								</f:facet>
								<h:outputText value="#{item.date}" />
							</h:column>

							<h:column headerClass="rightHead">
								<f:facet name="header">
									<h:commandLink class="ZsomborSearch"
										action="#{dateDTOController.sortBySender}">
										<h:outputText value="#{msg.sender}" />
										<h:panelGroup rendered="#{dateDTOController.showSenderIcon}">
											<h:graphicImage
												rendered="#{dateDTOController.sortAscending}"
												value="/resources/images/icon_up_sort_arrow.png" />
											<h:graphicImage
												rendered="#{!dateDTOController.sortAscending}"
												value="/resources/images/icon_down_sort_arrow.png" />
										</h:panelGroup>
									</h:commandLink>
								</f:facet>
								<h:outputText value="#{item.sender}" />
							</h:column>
						</h:dataTable>
					</h:panelGroup>

					<h:outputText id="noresults" value="#{msg.errorResult}"
						rendered="#{dateDTOController.errshow}" />
				</h:form>
			</center>
		</f:view>
	</ui:define>
</ui:composition>

</html>